package _2ChapterTwo._1MoveMethod.oldObject;

public class Account {
    private AccountType _accountType;
    private int _daysOverdrawn;

    public double overdraftCharge() {
        double result;
        if (_accountType.isPremium()) {
            result = 10;
            if (_daysOverdrawn > 7) {
                result += (_daysOverdrawn - 7) * 0.85;
            }
        } else {
            result = _daysOverdrawn * 1.75;
        }
        return result;
    }

    public double bankCharge() {
        double result = 4.5;
        if (_daysOverdrawn > 0) {
            result += overdraftCharge();
        }
        return result;
    }
}
